#include"BinaryTree.h"
#include<stdbool.h>

bool _IsSymmetric(BTNode* rootA, BTNode* rootB)
{
	if (rootA == NULL&&rootB == NULL)
		return true;
	if (rootA == NULL || rootB == NULL)
		return false;
	if (rootA->data != rootB->data)
		return false;
	return _IsSymmetric(rootA->left, rootB->right) && _IsSymmetric(rootA->right, rootB->left);
}

bool IsSymmetric(BTNode* root)
{
	if (root == NULL)
		return true;
	return _IsSymmetric(root->left, root->right);
}